package com.dfbz.springboot_project.mapper;

import com.dfbz.springboot_project.entity.Privilege;
import com.dfbz.springboot_project.entity.RolePrivilege;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.ArrayList;

@org.apache.ibatis.annotations.Mapper
public interface RolePrivilegeMapper extends Mapper<RolePrivilege> {
    @Delete("DELETE  " +
            "FROM " +
            " role_privilege  " +
            "WHERE " +
            " role_privilege.role_id =#{Rid}")
    void DeleteByRid(Integer Rid);
    @InsertProvider(type = RolePrivilegeProvider.class,method = "InsertSelective")
    void InsertSelective(@Param("Rid") Integer Rid, @Param("privileges") ArrayList<Privilege> privileges);
}
